package validate

import (
	"fiber/helper"
)

type UserRegister struct {
    Name string `form:"name" json:"name" validate:"required"`
    Mobile string `form:"mobile" json:"mobile" validate:"required,checkIdCard"`
    Password string `form:"password" json:"password" validate:"required"`
}

func (register UserRegister) GetMessages() helper.ValidatorMessages {
    return helper.ValidatorMessages{
        "Name.required": "用户名称不能为空",
        "Mobile.required": "手机号码不能为空",
        "Mobile.checkIdCard": "身份证号码格式不正确",
        "Password.required": "用户密码不能为空",
    }
}

type UserLogin struct {
    Mobile string `form:"mobile" json:"mobile" validate:"required,mobile"`
    Password string `form:"password" json:"password" validate:"required"`
}

func (login UserLogin) GetMessages() helper.ValidatorMessages {
    return helper.ValidatorMessages{
        "Mobile.required": "手机号码不能为空",
        "Mobile.mobile": "手机号码格式不正确",
        "Password.required": "用户密码不能为空",
    }
}



